package localhost.services.DeptsData;

public class DeptsDataPortTypeProxy implements DeptsDataPortType {
  private String _endpoint = null;
  private DeptsDataPortType deptsDataPortType = null;
  
  public DeptsDataPortTypeProxy() {
    _initDeptsDataPortTypeProxy();
  }
  
  public DeptsDataPortTypeProxy(String endpoint) {
    _endpoint = endpoint;
    _initDeptsDataPortTypeProxy();
  }
  
  private void _initDeptsDataPortTypeProxy() {
    try {
      deptsDataPortType = (new DeptsDataLocator()).getDeptsDataHttpPort();
      if (deptsDataPortType != null) {
        if (_endpoint != null) {
            ((javax.xml.rpc.Stub)deptsDataPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        } else {
            _endpoint = (String)((javax.xml.rpc.Stub)deptsDataPortType)._getProperty("javax.xml.rpc.service.endpoint.address");
        }
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (deptsDataPortType != null) {
        ((javax.xml.rpc.Stub)deptsDataPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    }
    
  }
  
  public DeptsDataPortType getDeptsDataPortType() {
    if (deptsDataPortType == null) {
        _initDeptsDataPortTypeProxy();
    }
    return deptsDataPortType;
  }

  @Override
  public Depts[] getDepts() throws java.rmi.RemoteException{
    if (deptsDataPortType == null) {
        _initDeptsDataPortTypeProxy();
    }
    return deptsDataPortType.getDepts();
  }
  
  
}